<template>
  <Spin :spinning="loading" tip="Loading...">
    <el-select v-model="auditId" placeholder="请选择" @change="changeAuditId">
      <el-option v-for="item in options" :key="item.auditId" :label="item.date" :value="item.auditId"> </el-option>
    </el-select>
    <FilterTables
      ref="table"
      columnsRef="salesChangeQuery"
      :isSelectColumn="false"
      :columns="columns"
      :dataSource="dataSource"
      :datakey="'records'"
      :onColumnsChange="(columns) => (this.columns = columns)"
    >
    </FilterTables>
    <div class="detailed" v-if="ttVsSolidAuditAccessoryPOS.length > 0">
      <el-row>
        <el-col :span="12">
          <FormPanel ref="formPanel5" :list="formList1" :labelPosition="'top'" :isSubmitBtn="false" :collapse="false" labelWidth="110" :cols="2" />
        </el-col>
        <el-col :span="12">
          <FormPanel ref="formPanel6" :list="formList2" :labelPosition="'top'" :isSubmitBtn="false" :collapse="false" labelWidth="110" :cols="2" />
        </el-col>
      </el-row>
    </div>
  </Spin>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
// import { IDNumber, zipCode, ownerLicensePlate, licenseNum } from '@/utils/validate';
import { getFindAuditIdS, getFindAuditById } from '@/api/omSaleP/ActualSales/KeyCustomerActualSales';
export default {
  props: {
    rowData: {
      type: Object,
      required: true,
    },
  },
  name: 'detail',
  mixins: [dictionary],
  data() {
    return {
      options: [],
      auditId: null,
      loading: false,
      columns: this.createdTable(),
      formList1: this.createdFrom1(),
      formList2: this.createdFrom2(),
      dataSource: [],
      ttVsSolidAuditAccessoryPOS: [],
    };
  },
  created() {
    this.getDetail();
  },
  methods: {
    async getDetail() {
      console.log(this.rowData);
      const res = await getFindAuditIdS({ actualSalesId: this.rowData.actualSalesId, solidType: this.rowData.solidType });
      console.log(res);
      if (res.resultCode === 200) {
        this.options = res.data;
        if (res.data.length > 0) {
          this.auditId = res.data[0].auditId;
          this.changeAuditId(this.auditId);
        }
      }
    },
    async changeAuditId(val) {
      this.loading = true;
      const dataTable = [
        {
          name: 'licenseVehicleNature',
          val: '2114'
        },
        {
          name: 'customerType',
          val: '2117',
        },
        {
          name: 'sex',
          val: '1002',
        },
        {
          name: 'ageStage',
          val: '2118',
        },
        {
          name: 'idTypeCode',
          val: '2120',
        },
        {
          name: 'occupationType',
          val: '2122',
        },
        {
          name: 'educationLevel',
          val: '1035',
        },
        {
          name: 'householdType',
          val: '2121',
        },
        {
          name: 'unitNature',
          val: '2123',
        },
        {
          name: 'industryType',
          val: '2124',
        },
        {
          name: 'intentLevel',
          val: '2129',
        },
        {
          name: 'maritalStatus',
          val: '2125',
        },
        {
          name: 'annualHouseholdIncome',
          val: '2126',
        },
        {
          name: 'hobby',
          val: '2129',
        },
        {
          name: 'favoriteContactType',
          val: '2131',
        },
        {
          name: 'convenientTime',
          val: '2128',
        },
        {
          name: 'isVip',
          val: '1004',
        },
        {
          name: 'purchasePurpose',
          val: '2127',
        },
        {
          name: 'isSpecialOrder',
          val: '1004',
        },
        {
          name: 'isThreeGuarantees',
          val: '1004',
        },
        {
          name: 'isAnotherPlace',
          val: '1004',
        },
        {
          name: 'buildChargingPiles',
          val: '1004',
        },
        {
          name: 'isApplySubsidies',
          val: '1004',
        },
        {
          name: 'isRebate',
          val: '1004',
        },
        {
          name: 'isReplace',
          val: '1004',
        },
        {
          name: 'isSalesSprint',
          val: '1004',
        },
        {
          name: 'isBuyAgain',
          val: '1004',
        },
        {
          name: 'isBatteryRental',
          val: '1004',
        },
        // {
        //   name: 'isTestDriveCar',
        //   val: '1004'
        // }
      ];
      const res = await getFindAuditById({ auditId: val, solidType: this.rowData.solidType });
      if (res.resultCode === 200) {
        console.log(res);
        this.dataSource = res.data.ttVsSolidAuditDetailPOS || [];
        this.ttVsSolidAuditAccessoryPOS = res.data.ttVsSolidAuditAccessoryMapperAllByAuditId || [];
        const filterName = (arr, val) => {
          // console.log(arr, val);
          const filterArr = arr.filter((item) => item.value == val);
          // console.log(filterArr);
          let returnName = '';
          if (filterArr.length > 0) {
            returnName = filterArr[0].text;
          } else {
            returnName = val;
          }
          console.log(returnName);
          return returnName;
        };
        const that = this;
        this.dataSource.forEach((item) => {
          const arr = dataTable.filter((value) => value.name == item.auditCode);
          if (arr.length > 0) {
            const filterItems = that.createDictList(arr[0].val);
            console.log(filterItems, arr[0].val);
            const value2 = filterName(filterItems, item.auditBefore);
            const value3 = filterName(filterItems, item.auditAfter);
            item.value2 = value2;
            item.value3 = value3;
          } else {
            item.value2 = item.auditBefore;
            item.value3 = item.auditAfter;
          }
        });
        this.fileClassification();
      }
      this.loading = false;
    },
    pushURL(item) {
      if (item.annexName) {
        item.data.push({
          name: item.annexName,
          uid: item.annexUid,
          url: item.annexUrl,
        });
      }
    },
    fileClassification() {
      let beforeData = this.ttVsSolidAuditAccessoryPOS.filter((item) => item.isChange === 0);
      let afterData = this.ttVsSolidAuditAccessoryPOS.filter((item) => item.isChange === 1);
      console.log('区分文件');
      console.log(beforeData, afterData);
      this.formList1.map((item) => {
        item.hidden = true;
        item.disabled = true;
        item.initialValue = [];
      });
      this.formList2.map((item) => {
        item.hidden = true;
        item.disabled = true;
        item.initialValue = [];
      });
      // let repeatAfterObj = {};
      // afterData.forEach(value => {
      //   const { billType } = value;
      //   if (repeatAfterObj[billType]) {
      //     repeatAfterObj[billType].item.data.push({
      //       name: item.annexName,
      //       uid: item.annexUid,
      //       url: item.annexUrl
      //     });
      //   } else {
      //     item.data = [];
      //     item.data.push({
      //       name: item.annexName,
      //       uid: item.annexUid,
      //       url: item.annexUrl
      //     });
      //     repeatAfterObj[billType] = {
      //       billType,
      //       child: item
      //     };
      //   }
      // });
      // console.log(Object.values(repeatAfterObj));

      const repeatAfter = afterData.filter((item) => {
        console.log(item.billType == 11121003, item.billType);
        return item.billType == 11121003;
      });
      let screenAfter = {};
      if (repeatAfter.length > 0) {
        screenAfter = { ...repeatAfter[0], data: [] };
        console.log(screenAfter, repeatAfter);
        repeatAfter.forEach((item) => {
          if (item.annexName) {
            screenAfter.data.push({
              name: item.annexName,
              uid: item.annexUid,
              url: item.annexUrl,
            });
          }
        });
      }
      const repeatBefore = beforeData.filter((item) => item.billType == 11121003);
      console.log(repeatAfter, repeatBefore);
      let screenBefore = {};
      if (repeatBefore.length > 0) {
        screenBefore = { ...repeatBefore[0], data: [] };
        console.log(screenBefore, repeatBefore);
        repeatBefore.forEach((item) => {
          if (item.annexName) {
            screenBefore.data.push({
              name: item.annexName,
              uid: item.annexUid,
              url: item.annexUrl,
            });
          }
        });
      }
      beforeData = beforeData.filter((item) => item.billType != 11121003);
      afterData = afterData.filter((item) => item.billType != 11121003);
      if (screenBefore.billType) {
        beforeData.push(screenBefore);
      }
      if (screenAfter.billType) {
        afterData.push(screenAfter);
      }
      console.log(screenBefore, screenBefore);
      console.log(beforeData, afterData);
      afterData.forEach((item) => {
        this.formList1.map((x) => {
          if (x.billType == item.billType) {
            x.hidden = false;
          }
        });
      });
      beforeData.forEach((item) => {
        console.log(item);
        if (item.billType !== 11121003) {
          // console.log(item)
          item.data = [];
          this.pushURL(item);
        }
        this.formList1.map((x) => {
          if (x.billType == item.billType) {
            console.log(x.billType, item.billType, x.label);
            x.initialValue = item.data;
          }
        });
      });
      afterData.forEach((item) => {
        if (item.billType !== 11121003) {
          //  console.log(item)
          item.data = [];
          this.pushURL(item);
        }
        this.formList2.map((x) => {
          if (x.billType == item.billType) {
            x.hidden = false;
            x.initialValue = item.data;
          }
        });
      });
    },
    createdTable() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          fixed: 'left',
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        {
          title: '变更字段类型',
          dataIndex: 'auditName',
          sorter: true,
          filter: true,
          filterType: 'input',
        },
        {
          title: '变更前',
          dataIndex: 'auditBefore',
          sorter: true,
          filter: true,
          filterType: 'input',
          render: (props) => <span>{props.row.value2}</span>,
        },
        {
          title: '变更后',
          dataIndex: 'auditAfter',
          sorter: true,
          filter: true,
          filterType: 'input',
          render: (props) => <span>{props.row.value3}</span>,
        },
        {
          title: '变更时间',
          dataIndex: 'createdAt',
          sorter: true,
          filter: true,
          filterType: 'input',
          dateFormat: 'yyyy-MM-dd HH:mm:ss',
        },
        {
          title: '变更人',
          dataIndex: 'createdBy',
          sorter: true,
          filter: true,
          filterType: 'input',
        },
      ];
    },
    createdFrom1() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '变更前',
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证正面',
          billType: 11121006,
          disabled: true,
          hidden: true,
          fieldName: 'identityCardFront',
          selfCols: 2,
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证反面',
          disabled: true,
          hidden: true,
          billType: 11121007,
          selfCols: 2,
          fieldName: 'identityCardReverse',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          billType: 11121008,
          disabled: true,
          hidden: true,
          label: '法人身份证正面',
          selfCols: 2,
          fieldName: 'legalIdentityCardFront',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          billType: 11121009,
          disabled: true,
          hidden: true,
          label: '法人身份证反面',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          fieldName: 'legalIdentityCardReverse',
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '营业执照',
          billType: 11121010,
          disabled: true,
          hidden: true,
          fieldName: 'businessLicense',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '管理员授权文件',
          billType: 11121016,
          disabled: true,
          hidden: true,
          fieldName: 'adminAuthorizationFiles',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证正面',
          billType: 11121017,
          disabled: true,
          hidden: true,
          fieldName: 'unitContactPersonCardFront',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证反面',
          billType: 11121018,
          disabled: true,
          hidden: true,
          fieldName: 'unitContactPersonCardReverse',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '大客户附件',
          billType: 11121011,
          disabled: true,
          hidden: true,
          fieldName: 'bigCustomerFiles',
          hidden: true,
          rules: [{ required: false, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '发票附件',
          disabled: true,
          hidden: true,
          billType: 11121001,
          fieldName: 'invoiceUidList',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '终端销售合同',
          selfCols: 2,
          disabled: true,
          hidden: true,
          billType: 11121004,
          fieldName: 'terminalSalesContract',
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '过程性合同',
          billType: 11121005,
          fieldName: 'proceduralContract',
          selfCols: 2,
          disabled: true,
          hidden: true,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '手持身份证照片',
          billType: 11121002,
          disabled: true,
          hidden: true,
          fieldName: 'holdIdentityCard',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '商业保险单',
          disabled: true,
          hidden: true,
          disabled: true,
          billType: 11121014,
          fieldName: 'commercialInsuranceFiles',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '交强保险单',
          disabled: true,
          hidden: true,
          billType: 11121015,
          fieldName: 'trafficlInsuranceFiles',
          selfCols: 2,
          rules: [],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '融资返利文件',
          billType: 11121012,
          disabled: true,
          hidden: true,
          fieldName: 'rebateFiles',
          selfCols: 2,
          rules: [],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf'],
            limit: 2,
            // tipText: '最多上传1个附件'
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '增换购附件',
          disabled: true,
          hidden: true,
          // disabled: true,
          fieldName: 'replaceFiles',
          selfCols: 2,
          billType: 11121013,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证正面',
          disabled: true,
          hidden: true,
          billType: 21121001,
          fieldName: 'vehicleLicenseFrontList',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证反面',
          billType: 21121002,
          disabled: true,
          hidden: true,
          selfCols: 2,
          fieldName: 'vehicleLicenseBackList',
          rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证正面',
          disabled: true,
          hidden: true,
          selfCols: 2,
          billType: 21121003,
          fieldName: 'drivingLicenseFrontList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证反页',
          disabled: true,
          hidden: true,
          billType: 21121004,
          selfCols: 2,
          fieldName: 'drivingLicenseBackList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '上牌信息其他附件',
          disabled: true,
          hidden: true,
          billType: 21121005,
          fieldName: 'otherFileUrlList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '销售信息其他附件',
          disabled: true,
          hidden: true,
          billType: 11121003,
          fieldName: 'attachmentUidsList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 10,
          },
        },
      ];
    },
    createdFrom2() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '变更后',
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证正面',
          billType: 11121006,
          disabled: true,
          hidden: true,
          fieldName: 'identityCardFront',
          selfCols: 2,
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '身份证反面',
          disabled: true,
          hidden: true,
          billType: 11121007,
          selfCols: 2,
          fieldName: 'identityCardReverse',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          billType: 11121008,
          disabled: true,
          hidden: true,
          label: '法人身份证正面',
          selfCols: 2,
          fieldName: 'legalIdentityCardFront',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          billType: 11121009,
          disabled: true,
          hidden: true,
          label: '法人身份证反面',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          fieldName: 'legalIdentityCardReverse',
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '营业执照',
          billType: 11121010,
          disabled: true,
          hidden: true,
          fieldName: 'businessLicense',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '管理员授权文件',
          billType: 11121016,
          disabled: true,
          hidden: true,
          fieldName: 'adminAuthorizationFiles',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证正面',
          billType: 11121017,
          disabled: true,
          hidden: true,
          fieldName: 'unitContactPersonCardFront',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '授权人身份证反面',
          billType: 11121018,
          disabled: true,
          hidden: true,
          fieldName: 'unitContactPersonCardReverse',
          // rules: [{ required: true, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '大客户附件',
          billType: 11121011,
          disabled: true,
          hidden: true,
          fieldName: 'bigCustomerFiles',
          hidden: true,
          rules: [{ required: false, message: '请上传', trigger: 'change' }],
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '发票附件',
          disabled: true,
          hidden: true,
          billType: 11121001,
          fieldName: 'invoiceUidList',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '终端销售合同',
          selfCols: 2,
          disabled: true,
          hidden: true,
          billType: 11121004,
          fieldName: 'terminalSalesContract',
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '过程性合同',
          billType: 11121005,
          fieldName: 'proceduralContract',
          selfCols: 2,
          disabled: true,
          hidden: true,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '手持身份证照片',
          billType: 11121002,
          disabled: true,
          hidden: true,
          fieldName: 'holdIdentityCard',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '商业保险单',
          disabled: true,
          hidden: true,
          disabled: true,
          billType: 11121014,
          fieldName: 'commercialInsuranceFiles',
          selfCols: 2,
          rules: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '交强保险单',
          disabled: true,
          hidden: true,
          billType: 11121015,
          fieldName: 'trafficlInsuranceFiles',
          selfCols: 2,
          rules: [],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '融资返利文件',
          billType: 11121012,
          disabled: true,
          hidden: true,
          fieldName: 'rebateFiles',
          selfCols: 2,
          rules: [],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf'],
            limit: 2,
            // tipText: '最多上传1个附件'
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '增换购附件',
          disabled: true,
          hidden: true,
          billType: 11121013,
          // disabled: true,
          fieldName: 'replaceFiles',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'change' }],
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'pdf', 'xls', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证正面',
          disabled: true,
          hidden: true,
          billType: 21121001,
          fieldName: 'vehicleLicenseFrontList',
          selfCols: 2,
          rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '行驶证反面',
          billType: 21121002,
          disabled: true,
          hidden: true,
          selfCols: 2,
          fieldName: 'vehicleLicenseBackList',
          rules: [{ required: true, message: '请上传', trigger: 'blur' }],
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证正面',
          disabled: true,
          hidden: true,
          selfCols: 2,
          billType: 21121003,
          fieldName: 'drivingLicenseFrontList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '驾驶证反页',
          disabled: true,
          hidden: true,
          billType: 21121004,
          selfCols: 2,
          fieldName: 'drivingLicenseBackList',
          // selfCols: 3,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'bmp'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '上牌信息其他附件',
          disabled: true,
          hidden: true,
          billType: 21121005,
          fieldName: 'otherFileUrlList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 1,
            tipText: '最多上传1个附件',
          },
        },
        {
          type: 'UPLOAD_FILE',
          label: '销售信息其他附件',
          disabled: true,
          hidden: true,
          billType: 11121003,
          fieldName: 'attachmentUidsList',
          selfCols: 2,
          upload: {
            actionUrl: '/api/file/oss/upload',
            fileTypes: ['jpg', 'png', 'xls', 'pdf', 'xlsx', 'rar', 'zip'],
            limit: 10,
          },
        },
      ];
    },
  },
};
</script>

<style></style>
